package task3_13;

/**
 * Create by IntelliJ IDEA
 *
 * @author: banana
 * @date-Time: 2018/4/13 8:24
 * @description:三角形：继承抽象类
 */
public class Triangle extends Shape {
  double a;
  double h;
  public Triangle(){}
  public Triangle(double a,double h){
    this.a=a;
    this.h=h;
  }

  @Override
  public double area() {
    return a*h/2;
  }

  @Override
  public String getName() {
    return"三角形";
  }

  @Override
  public void output() {
    System.out.println(getName()+"面积是："+area());
  }
}
